package com.bhf.task;

import com.bhf.model.entity.UserOperationLog;
import com.bhf.service.UserOperationLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;

/**
 * @author pwq
 */
@Component
@Slf4j
public class AsyncTask {

    @Resource
    private UserOperationLogService userOperationLogService;

    @Async
    public void insertUserOperationLog(UserOperationLog operationLog){
        userOperationLogService.save(operationLog);
        log.info("线程的名字：{}",Thread.currentThread().getName());
    }
}
